package com.beyondsoft.mcms.web;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.security.core.Authentication;
import org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler;

public class AuthSuccessHandler extends SavedRequestAwareAuthenticationSuccessHandler {

	@Override
	public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response,
			Authentication authentication) throws ServletException, IOException {

		String contextPath = request.getContextPath();
		request.getSession().setAttribute("contextPath", contextPath);
		// getRedirectStrategy().sendRedirect(request, response, "");
		super.onAuthenticationSuccess(request, response, authentication);
	}

}
